package www.wmx.com.xssc.util.enumUtil;

public enum TjdjEnum {

    // 定义错误代码和错误信息的对应关系
    TDJ(0, "特等奖"),
    YDJ(1, "一等奖"),
    EDJ(2, "二等奖"),
    SDJ(2,"三等奖"),
    ;

    private final int code;
    private final String message;

    // 构造函数为每个枚举实例赋值
    TjdjEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    // 获取错误代码
    public int getCode() {
        return code;
    }

    // 获取错误信息
    public String getMessage() {
        return message;
    }


    public static TjdjEnum getByCode(int code) {
        for (TjdjEnum tjdjEnum : TjdjEnum.values()) {
            if (tjdjEnum.getCode() == code) {
                return tjdjEnum;
            }
        }
        return null;
    }
}
